<div class=" panel-body table-container" id="main-table">
 <%if (isJg){%>   
    <div class="btn-toolbar" id="btn-toolbar" role="toolbar" aria-label="...">
      <ul class="nav nav-tabs">
        <li role="presentation" class="active"><a href="#" data-url="/aqjg"><span class="glyphicon glyphicon-lock"></span> 安监</a></li>
        <li role="presentation"><a href="#" data-url="/ldjg"><span class="glyphicon glyphicon-tasks"></span> 劳监</a></li>
        <li role="presentation"><a href="#" data-url="/hbjg"> <span class="glyphicon glyphicon-globe"></span> 环保</a></li>
        <li role="presentation"><a href="#" data-url="/syjg"><span class="glyphicon glyphicon-cutlery"></span> 食药</a></li>
      </ul>
    </div>
<%}%>
    <div class="table-container">
        <table class="table table-hover" id="main-table">
            <thead>
                <tr>
                    <th>序号</th>
                <% for (items in tableNames) {
                    var item = tableNames[items];
                %>
                        <th><%=item%></th>
                <%}%>
                </tr>
            </thead>
            <tbody>
                <%for (tableData in table) {%>
                <tr>
                    <td><%=Number(tableData)+1%></td>
                <% for (items in tableNames) {
                    var item = table[tableData][items];
                %>
                    <td><%=item%></td>
                <%}%>
                </tr>
                <%}%>
            </tbody>
        </table>
    </div>
    <div style="text-align:center">
        <ul id="pagination" class="pagination" data-url="<%=tableUrl%>">
          <li <%var current_ = current; if (current == 1) {%>class="disabled"<%}%>><a data-url="<%=current-1%>" href="#">&laquo;</a></li>
          <li><a href="#" data-url="<%=1%>">首页</a></li>
          <% if (current != 1) {%>
            <li class="disabled"><a href="#">...</a></li>
          <% } %>
          <li class="active"><a href="#" data-url="<%=current%>"><%=current%></a></li>
          <%
            var end = current+3; 
            for (current = current+1; current < end && current <= total; current++) {%>
            <li><a data-url="<%=current%>" href="#"><%=current%></a></li>
          <%}%>
          <% if (current < total) {%>
            <li class="disabled"><a href="#">...</a></li>
          <% } %>
          <li><a href="#" data-url="<%=total%>">尾页(<%=total%>)</a></li>

          <li <% if (end == total+3) {%>class="disabled"<%}%>><a data-url="<%=current_+1%>" href="#">&raquo;</a></li>
        </ul>
    </div>
</div>